package com.android.yinghebike.ui.activity;

import android.view.View;
import android.widget.TextView;

import com.android.baselibrary.util.Util;
import com.android.baselibrary.view.Comm_HeadView;
import com.android.yinghebike.R;
import com.android.yinghebike.constants.Constants;
import com.android.yinghebike.manager.LanguageManager;

import java.util.Locale;

import butterknife.BindView;
import butterknife.OnClick;

public class AboutUsActivity extends BaseActivity {

    @BindView(R.id.comm_title)
    Comm_HeadView comm_title;
    @BindView(R.id.tv_version)
    TextView tv_version;


    @Override
    protected int getLayoutId() {
        return R.layout.activity_aboutus;
    }

    @Override
    protected void initView() {
        comm_title.setTitle(getString(R.string.mine_aboutus));
    }

    @Override
    protected void initData() {
        tv_version.setText("v " + Util.getVersionName(mContext));   //设置版本号
    }

    @OnClick({R.id.ll_yingsi})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.ll_yingsi:
                Locale locale = LanguageManager.getLocale();
                String filePath = "";
                if (locale.getLanguage().equals(Locale.CHINESE.getLanguage())) {
                    filePath = "file:///android_asset/yinsixieyi.html";
                } else if (locale.getLanguage().equals(Locale.ENGLISH.getLanguage())) {
                    filePath = "file:///android_asset/yinsixieyi_en.html";
                }
                WebViewActivity.startActivity(mContext, getString(R.string.aboutus_user_agreement), filePath);
                break;
        }
    }
}
